import React from 'react'
import {HashRouter,Router,Link} from 'react-router-dom'
import Main from './Main'
import About from './about'
import Topic from './topic'
export default class Home extends React.Component{
    render(){
        return(
            <HashRouter>
                <div>
                    <ul>
                        <li>
                            <Link to="/">Home</Link>
                        </li>
                        <li>
                            <Link to="/about">About</Link>
                        </li>
                        <li>
                            <Link to="/topics">Topics</Link>
                        </li>
                    </ul>
                    <hr/>
                    {/*在router4.0中我们可以用exact精确加载路由，当然也可以用switch和exact，与js的一样*/}
                    <Router path="/" component={Main}/>
                    <Router path="/about" component={About}/>
                    <Router path="/topics" component={Topic}/>
                </div>
            </HashRouter>
        )
    }
}